<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><!--Head--><head>
    <meta charset="utf-8">
    <title>童老师ThinkPHP交流群：484519446</title>
    <meta name="description" content="login page">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__STYLE__/bootstrap.css" rel="stylesheet">
    <link href="__STYLE__/font-awesome.css" rel="stylesheet">
    <!--Beyond styles-->
    <link id="beyond-link" href="__STYLE__/beyond.css" rel="stylesheet">
    <link href="__STYLE__/demo.css" rel="stylesheet">
    <link href="__STYLE__/animate.css" rel="stylesheet">
    <link href="__LAYER__/skin/default/layer.css" rel="stylesheet">
</head>
<!--Head Ends-->
<!--Body-->

<body>
    <div class="login-container animated fadeInDown">
        <form action="" method="post" id="userForm">
            <div class="loginbox bg-white">
                <div class="loginbox-title">SIGN IN</div>
                <div class="loginbox-textbox">
                    <input value="admin" class="form-control" placeholder="username" name="name" type="text">
                </div>
                <div class="loginbox-textbox">
                    <input class="form-control" placeholder="password" name="password" type="password">
                </div>
                <div class="loginbox-submit">
                    <input class="btn btn-primary btn-block" value="Login" id="btn" type="button">
                </div>
            </div>
                <div class="logobox">
                    <p class="text-center">童老师ThinkPHP交流群：4845194464</p>
                </div>
        </form>
    </div>
    <!--Basic Scripts-->
    <script src="__STYLE__/jquery.js"></script>
    <script src="__STYLE__/bootstrap.js"></script>
    <script src="__STYLE__/jquery_002.js"></script>
    <script src="__STYLE__/jquery-1.10.1.js"></script>
    <!--Beyond Scripts-->
<!--     <script src="__STYLE__/beyond.js"></script> -->
    <script src="__LAYER__/layer.js"></script>
    <script type="text/javascript">
        $('#btn').on('click',function(){
            var userForm = $('#userForm').serializeArray();
            var fields = [];    
            $(userForm).each(function(i, field){
                fields[field.name] = field.value;
            });
            if(fields.name && fields.password){
                $.post("{:url('login')}",userForm,function(data){
                    if(data === 1){
                        location.href="{:url('index/index')}";
                    }else{
                        layer.msg('密码错误');
                    }
                }); 
            }else{
                layer.msg('密码错误');
            }    
        });
    </script>
</body><!--Body Ends--></html>